﻿using Hong.IRepository.IRepository_SystemSettings;
using Hong.Model.SysDomain.Model_SystemSettings;
using Hong.Model.SysDomain.Model_SystemSettings.ViewModel;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace WeHongshibApI.Controllers.Controllers_SystemSettings
{
    [ApiExplorerSettings(GroupName = "SystemSettings")]
    [Route("api/[controller]")]
    [ApiController]
    public class NoticeController : ControllerBase
    {
        #region 构造器API注入
        private readonly INotice _notice;

        public NoticeController(INotice notice)
        {
            _notice = notice;
        }
        #endregion

        #region 添加公告
        [HttpPost, Route("AddUR")]
        public IActionResult AddNper(NnperModel nnper)
        {
            var role = _notice.AddNper(nnper);
            return Ok(role);

           

        }
        #endregion

        #region 加载公告
        [HttpGet, Route("GetPer")]
        public IActionResult GetPer(string PersonnelName, int pageindex, int pagesize)
        { 
            var role= _notice.GetPer(PersonnelName, pageindex, pagesize);
            return Ok(role);
        }
        #endregion

        [HttpGet, Route("getRM")]
        public IActionResult getRM()
        { 
            var role=_notice.getRM();
            return Ok(role);
        }

        #region 按部门现实人员
        [HttpGet, Route("selecPer")]
        public IActionResult selecPer(int depId)
        { 
            var role=_notice.selecPer(depId);
            return Ok(role);
        }
        #endregion
    }
}
